Class CF.NUR.MNISV3.AndroidBroadcast Extends %Persistent
{

Property AddDate As %Library.Date(FORMAT = 1) [ InitialExpression = {+$p($h,",",1)}, Required ];

Property AddTime As %Library.Time [ InitialExpression = {+$p($h,",",2)}, Required ];

Property Name As %String(TRUNCATE = 1);

Property Action As %String(MAXLEN = 100, TRUNCATE = 1);

Property Decode As %String(MAXLEN = 100, TRUNCATE = 1);

Index ActionDecode On (Action, Decode);

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("CHENWEI","com.scanner.broadcast","data")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("LIANXI","lachesis_barcode_value_notice_broadcast","lachesis_barcode_value_notice_broadcast_data_string")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("CARIBE","scan.rcv.message","barocode")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("IDATA","android.intent.action.SCANRESULT","value")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("HONEYWELL","com.honeywell.testbroadcast","data")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("dddt","com.mipha.ScanDemo.ACTION_DECODE_RESULT","data")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("HISENSE","android.provider.sdlMessage","msg")

// d ##class(CF.NUR.MNISV3.AndroidBroadcast).InsertData("SHANGMI","com.sunmi.scanner.ACTION_DATA_CODE_RECEIVED","data")

ClassMethod InsertData(Name As %String, Action As %String, Decode As %String) As %String
{
	s rw=$o(^CF.NUR.MNISV3.AndroidBroadcastI("ActionDecode"," "_$ZCVT(Action,"U")," "_$ZCVT(Decode,"U"),""))
	q:rw'="" rw
	s a=##class(CF.NUR.MNISV3.AndroidBroadcast).%New()
    s a.Name =Name
	s a.Action=Action
	s a.Decode=Decode
	d a.%Save()
	q a.%Id()
}

ClassMethod DeleteData(rw As %String) As %String
{
	q:rw="" 0
	s a=##class(CF.NUR.MNISV3.AndroidBroadcast).%DeleteId(rw)
	q 1
}

Storage Default
{
<Data name="AndroidBroadcastDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AddDate</Value>
</Value>
<Value name="3">
<Value>AddTime</Value>
</Value>
<Value name="4">
<Value>Name</Value>
</Value>
<Value name="5">
<Value>Action</Value>
</Value>
<Value name="6">
<Value>Decode</Value>
</Value>
</Data>
<DataLocation>^CF.NUR.MNISV3.AndroidBroa94E7D</DataLocation>
<DefaultData>AndroidBroadcastDefaultData</DefaultData>
<IdLocation>^CF.NUR.MNISV3.AndroidBroa94E7D</IdLocation>
<IndexLocation>^CF.NUR.MNISV3.AndroidBroa94E7I</IndexLocation>
<StreamLocation>^CF.NUR.MNISV3.AndroidBroa94E7S</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}
